/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.i.kotionokyurievna.jewelry.domain.material;

/**
 *
 * @author Kateryna_Reznik
 */
public class Material {
    private int materialId;
    private MaterialType materialType;
    private String materialTitle;
    private String quality;

    public Material() {
    }

    public Material(MaterialType materialType, String materialTitle, String quality) {
        this.materialType = materialType;
        this.materialTitle = materialTitle;
        this.quality = quality;
    }

    public Material(int materialId, MaterialType materialType, String materialTitle, String quality) {
        this.materialId = materialId;
        this.materialType = materialType;
        this.materialTitle = materialTitle;
        this.quality = quality;
    }

    public int getMaterialId() {
        return materialId;
    }

    public MaterialType getMaterialType() {
        return materialType;
    }

    public void setMaterialType(MaterialType materialType) {
        this.materialType = materialType;
    }

    public String getMaterialTitle() {
        return materialTitle;
    }

    public void setMaterialTitle(String materialTitle) {
        this.materialTitle = materialTitle;
    }

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        this.quality = quality;
    }

    @Override
    public String toString() {
        return "Material{" + "materialId=" + materialId + ", materialType=" + 
                materialType + ", materialTitle=" + materialTitle + 
                ", quality=" + quality + '}';
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 89 * hash + (this.materialType != null ? this.materialType.hashCode() : 0);
        hash = 89 * hash + (this.materialTitle != null ? this.materialTitle.hashCode() : 0);
        hash = 89 * hash + (this.quality != null ? this.quality.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Material other = (Material) obj;
        if (this.materialType != other.materialType) {
            return false;
        }
        if ((this.materialTitle == null) ? (other.materialTitle != null) : 
                !this.materialTitle.equals(other.materialTitle)) {
            return false;
        }
        if ((this.quality == null) ? (other.quality != null) : 
                !this.quality.equals(other.quality)) {
            return false;
        }
        return true;
    }    
}
